#version 300 es

#ifdef GL_ES
precision mediump float;
#endif

#define TWO_PI 6.28318530718

uniform vec2 u_resolution;
uniform float u_time;

float circle(vec2 st, vec2 pos, float radius) {
  vec2 p = st - pos;
  float rs = radius * radius;

  return smoothstep(rs + 0.003, rs - 0.002, dot(p, p));
}

out vec4 outColor;

void main() {

  float solution = min(u_resolution.x, u_resolution.y);
  vec2 st = (gl_FragCoord.xy - u_resolution / 2.0) / solution;
  vec2 s = vec2(1.0, 1.0) - step(0.5, abs(st));
  if(s.x * s.y < 0.00001) {
    discard;
  }

  vec3 color = vec3(0.1);

  float pct = circle(st, vec2(0.03, -0.1), 0.3);
  color = mix(color, vec3(1.0, 0.0, 0.0), pct); // area

  outColor = vec4(color, 1.0);
}
